<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui">

<p:panel header="Reporte Resumen de Cálculos" toggleable="true" collapsed="false">
<p:toolbar>
    <p:toolbarGroup align="right">
        <p:commandLink ajax="false" process="@this"
                       actionListener="#{jsfBean.printExcelReportAction}">
            <p:graphicImage value="../resources/images/newExcel.png" width="25px" height="25px"/>
            <f:attribute name="templateFile" value="#{jasperReporte}"/>
            <f:attribute name="templateType" value="xls"/>
            <f:attribute name="reportType" value="#{tipoReporte}"/>
        </p:commandLink>
        <p:commandLink ajax="false" process="@this"
                       actionListener="#{jsfBean.printExcelReportAction}">
            <p:graphicImage value="../resources/images/pdf.png" width="25px" height="25px"/>
            <f:attribute name="templateFile" value="#{jasperReporte}"/>
            <f:attribute name="templateType" value="pdf"/>
            <f:attribute name="reportType" value="#{tipoReporte}"/>
        </p:commandLink>
    </p:toolbarGroup>
</p:toolbar>
<p:dataTable id="dt_resumen" value="#{jsfBean.detalleResumen}"
             var="item" rowKey="#{item.entidad}"
             rows="10" paginator="true"
             paginatorPosition="bottom" emptyMessage="No existen registros"
             paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
             rowsPerPageTemplate="5,10,25,50">
    <p:columnGroup type="header">
        <p:row>
            <p:column headerText="Descripción" />
            <p:column headerText="Totales SIGAR" />
            <p:column headerText="Totales BC SAP"/>
            <p:column headerText="Diferencia"/>
        </p:row>
    </p:columnGroup>
    <p:column styleClass="columnLeftTopClass" style="min-width:100px" >
        <h:outputText value="#{item.nombre}"/>
    </p:column>
    <p:column styleClass="columnRightTopClass" style="min-width:100px" >
        <h:outputText value="#{item.totalSigar}">
            <f:convertNumber pattern="###,###,##0.00" locale="en-US"/>
        </h:outputText>
    </p:column>
    <p:column styleClass="columnRightTopClass" style="min-width:30px">
            <h:outputText value="#{item.totalSap}">
                <f:convertNumber pattern="###,###,##0.00" locale="en-US"/>
            </h:outputText>
    </p:column>
    <p:column styleClass="columnRightTopClass" style="min-width:30px">
            <h:outputText value="#{item.diferencia}">
                <f:convertNumber pattern="###,###,##0.00" locale="en-US"/>
            </h:outputText>
    </p:column>
</p:dataTable>
</p:panel>
    <br/>
    <br/>
</ui:composition>
